<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    		<form class="form-horizontal" action="/domain/link/save" method="post" id="domainForm">
		    <fieldset>
		
		    <div class="control-group">
		<input name="id" value="${domain.id }" type="hidden">
		          <!-- Text input-->
		          <label class="control-label" for="input01">名称：</label>
		          <div class="controls">
		            <input type="text"  class="input-xlarge" name="name" value="${domain.name }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
				<div class="control-group">
		
		          <!-- Text input-->
		          <label class="control-label" for="input01">链接：</label>
		          <div class="controls">
		            <input type="text"  class="input-xlarge" name="domain" value="${domain.domain }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
		        
		        
		 	<div class="control-group">
		
		          <div class="controls">
		           
		            <button type="submit" class="btn">提交</button>
		          </div>
		        </div>
		    </fieldset>
  			</form>

<script type="text/javascript">
   $(document).ready(function() {
	   
	   

		$('#domainForm').ajaxForm({
			beforeSubmit:function(){
				return $('#domainForm').validate().form();
			},
			success:function(){
				$('#div_right').load("/domain/link/manage");
			}
		});
	
	   $("#domainForm").validate({
			rules: {
				name: {required:true,maxlength:16,minlength:2},
				domain: {required:true,url:true}
			},
			messages: {
				name: {required:"请填写链接名称",maxlength:"您输入的字符数不能大于 16 位",minlength:"您输入的字符数不能小于 2位"},
				domain: {required:"请填写链接地址",url:"请填写合法的地址"},
			}
		});

   });
</script>
